<template>
  <div class="header-tab">
    <div class="tabs">
      <div class="one-tab" v-for="(item, index) in tabs" :key="index" @click="selectOne(item, index)">
        {{ item.name }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return{
      tabs: [
        {id:1, name: "订货信息", path:"orderingInfo", isActive: true},
        {id:2, name: "备货完成", path:"stock", isActive: false},
        {id:3, name: "配货完成", path:"distribute", isActive: false},
        {id:4, name: "问题订单", path:"problemOrder", isActive: false}
      ],
      isActive:false
    }
    },
  props: ['text'],

  methods: {
    selectOne (item) {
      this.tabs.forEach(res => {
        if(res.id === item.id) {
          item.isActive = true
        }
      })
    },
  }
}
</script>

<style>
.card {
  padding: 10px;
}
</style>
